package com.qiyue.admin.controller.base.dict;

import com.github.pagehelper.Page;
import com.qiyue.admin.biz.base.dict.DictValueBiz;
import com.qiyue.admin.constant.AdminCommonConstant;
import com.qiyue.admin.entity.base.dict.DictValue;
import com.qiyue.common.controller.BaseController;
import com.qiyue.vo.Result;
import com.qiyue.vo.TableResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * created by yebinghuan on 2018/4/2
 */
@RestController
@RequestMapping(AdminCommonConstant.URL.URI_API +"dictValue")
@Api("数据字典集合")
public class DictValueController extends BaseController<DictValueBiz,DictValue> {


    @GetMapping("/type/{code}")
    @ApiOperation("获取字典集合 分页")
    public TableResult<DictValue> pageDictValueByCode(@PathVariable("code")String code){
       List<DictValue> result= this.baseBiz.pageDictValueByCode(code);
        return new TableResult<DictValue>(result.size(),result);
    }


//    @GetMapping("/{code}")
//    @ApiOperation("获取详情")
//    public Result<DictValue> getDictByCode(@PathVariable("code")String code){
//
//        DictValue
//
//    }
}
